jQuery(document).ready(function () {
	$("#s1, #s2, #s3").dropdownchecklist({icon: { placement: 'right' },width:148, maxDropHeight: 100});
	$("#s4").dropdownchecklist({icon: { placement: 'right' },width:130, maxDropHeight: 100});
	$('.Scrollpane').jScrollPane();
	$("a[rel=example_group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition'		: 'inside',
		'hideOnOverlayClick': 'true'
	});
	$('#fileInput').show();
	$('#fileInput').uploadify({
		'uploader'  : '../resources/uploadify2.1/uploadify.swf',
		'script'    : '../resources/uploadify2.1/uploadify.php',
		'cancelImg' : '../resources/uploadify2.1/cancel.png',
		'buttonImg' : '../resources/uploadify2.1/btn-chonanh1.jpg',
		'moverImg' : '../resources/uploadify2.1/btn-chonanh1.jpg',
		'vmode': "transparent",
		'width': 74,
		'height': 29,
		'folder'    : '../resources/uploads',
		'script'    : '../resources/uploadify',
		'auto'      : true
	});
});

function showDialogFancy( title, nameId ) {
	title += '<img src="../resources/images/loading-white.gif" width="16" height="16" alt="Đang tải" class="LoadingStyle" />'
	var html=$('#' + nameId).html();
	$.fancybox(
		html, {	
			'title': title,
			showCloseButton:true,
			onComplete: function(){
				$('#fancybox-wrap .DScrollpane').jScrollPane();
			}
		}
	);
	return false;
}

function showConfirm(){
	jConfirm('Bạn có thật sự muốn xóa bản tin này không?', "Xác nhận", 
	function(r) {
		if(r==true){}
	});
	return false;
}

function showAlert(){
	jAlert('Mỗi lần bạn chỉ có thể mời tối đa 5 người', "Thông báo", 
	function(r) {
		if(r==true){}
	});
	return false;
}

function openGeneralDialog(idName, titleName, addedClassName, heightNumber){
	if( titleName != null ) {
		titleName += '<img src="../resources/images/loading-white.gif" width="16" height="16" alt="Đang tải" class="LoadingStyle" />';
	}
	$(idName).dialog({
		title: titleName, 
		modal: true, 
		resizable: false, 
		width:514, 
		height:heightNumber,
		open: function(event, ui) {
			$('.ui-dialog').addClass(addedClassName);
			$('.ui-dialog').append('<div class="UiJquryDialogLTCorner UiJquryDialogCorner"></div>');
			$('.ui-dialog').append('<div class="UiJquryDialogMTCorner UiJquryDialogCorner" style="clip:rect(auto, auto, auto, 16px);"></div>');
			$('.ui-dialog').append('<div class="UiJquryDialogRTCorner UiJquryDialogCorner"></div>');
			$('.ui-dialog').append('<div class="UiJquryDialogRMCorner UiJquryDialogCorner" style="clip:rect(16px, auto, auto, auto);"></div>');
			$('.ui-dialog').append('<div class="UiJquryDialogRBCorner UiJquryDialogCorner"></div>');
			$('.ui-dialog').append('<div class="UiJquryDialogMBCorner UiJquryDialogCorner" style="clip:rect(auto, auto, auto, 16px);"></div>');
			$('.ui-dialog').append('<div class="UiJquryDialogLBCorner UiJquryDialogCorner"></div>');
			$('.ui-dialog').append('<div class="UiJquryDialogLMCorner UiJquryDialogCorner" style="clip:rect(16px, auto, auto, auto);"></div>');
		}
	});
	return false;
};